<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>用vim的方式操作你的软件 | 净土</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="vim-like, vim plugins, vim 插件">
<meta property="og:type" content="article">
<meta property="og:title" content="用vim的方式操作你的软件">
<meta property="og:url" content="http://howiefh.github.io/2012/03/17/software-which-behaves-like-vim/index.html">
<meta property="og:site_name" content="净土">
<meta property="og:description" content="vim-like, vim plugins, vim 插件">
<meta property="og:image" content="http://www.viemu.com/viemu-movie.gif">
<meta property="og:updated_time" content="2015-07-13T15:56:22.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="用vim的方式操作你的软件">
<meta name="twitter:description" content="vim-like, vim plugins, vim 插件">
  
    <link rel="alternative" href="/atom.xml" title="净土" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.ico">
  
  <link href="http://fonts.useso.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="/css/style.css" type="text/css">
  
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-40492061-1', 'auto');
ga('send', 'pageview');

</script>


  
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?56d2899c5e919fbf4a7b00de5d1c31dd";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>


</head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">净土</a>
      </h1>
      
        <h2 id="subtitle-wrap">
          <a href="/" id="subtitle">乐不在外而在心，心以为乐，则是境皆乐；心以为苦，则无境不苦。</a>
        </h2>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-github-link" class="nav-icon" href="https://github.com/howiefh" title="Github" target="_blank"></a>
        
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed" target="_blank"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://howiefh.github.io"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-software-which-behaves-like-vim" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    
<a href="/2012/03/17/software-which-behaves-like-vim/" class="article-date">
  <time datetime="2012-03-17T15:03:09.000Z" itemprop="datePublished">2012-03-17</time>
</a>


    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Vim/">Vim</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      用vim的方式操作你的软件
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
		
		<div id="toc" class="toc-article">
			<h2 class="toc-title"><span>Contents</span></h2>
		
			<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Visual_Studio中的Vim插件"><span class="toc-number">1.</span> <span class="toc-text">Visual Studio中的Vim插件</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#ViEmu（收费）"><span class="toc-number">1.1.</span> <span class="toc-text">ViEmu（收费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#VsVim（免费）"><span class="toc-number">1.2.</span> <span class="toc-text">VsVim（免费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#visual_studio-vim（免费）"><span class="toc-number">1.3.</span> <span class="toc-text">visual_studio.vim（免费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#VisVim（免费）"><span class="toc-number">1.4.</span> <span class="toc-text">VisVim（免费）</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Eclipse中的vim插件"><span class="toc-number">2.</span> <span class="toc-text">Eclipse中的vim插件</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#viPlugin（收费）"><span class="toc-number">2.1.</span> <span class="toc-text">viPlugin（收费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Vrapper（免费）"><span class="toc-number">2.2.</span> <span class="toc-text">Vrapper（免费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#VimPlugin（免费）"><span class="toc-number">2.3.</span> <span class="toc-text">VimPlugin（免费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#eclim（免费）"><span class="toc-number">2.4.</span> <span class="toc-text">eclim（免费）</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Netbeans_IDE中的Vim插件：Jvi"><span class="toc-number">3.</span> <span class="toc-text">Netbeans IDE中的Vim插件：Jvi</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#JetBrains_中的Vim插件：IdeaVIM"><span class="toc-number">4.</span> <span class="toc-text">JetBrains 中的Vim插件：IdeaVIM</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Chrome"><span class="toc-number">5.</span> <span class="toc-text">Chrome</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Vimium"><span class="toc-number">5.1.</span> <span class="toc-text">Vimium</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Vrome"><span class="toc-number">5.2.</span> <span class="toc-text">Vrome</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Firefox"><span class="toc-number">6.</span> <span class="toc-text">Firefox</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Pentadactyl"><span class="toc-number">6.1.</span> <span class="toc-text">Pentadactyl</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Vimperator"><span class="toc-number">6.2.</span> <span class="toc-text">Vimperator</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#在bash中使用vi"><span class="toc-number">7.</span> <span class="toc-text">在bash中使用vi</span></a></li></ol>
		
		</div>
		
        <h2 id="Visual_Studio中的Vim插件">Visual Studio中的Vim插件</h2><h3 id="ViEmu（收费）">ViEmu（收费）</h3><p>地址：<a href="http://www.viemu.com/" target="_blank" rel="external">http://www.viemu.com/</a></p>
<p><img src="http://www.viemu.com/viemu-movie.gif" alt="ViEmu" title="ViEmu"></p>
<p>还有可以在Word，Outlook和SQL Server Management Studio中使用的ViEmu。</p>
<a id="more"></a>
<h3 id="VsVim（免费）">VsVim（免费）</h3><p>地址：<a href="https://github.com/jaredpar/VsVim/" target="_blank" rel="external">https://github.com/jaredpar/VsVim/</a></p>
<p>以上两个插件基本命令都有了，不过还是ViEmu更强。</p>
<h3 id="visual_studio-vim（免费）">visual_studio.vim（免费）</h3><p>地址：<a href="http://www.vim.org/scripts/script.php?script_id=864" target="_blank" rel="external">http://www.vim.org/scripts/script.php?script_id=864</a></p>
<p>支持Visual Studio 2003, 2005 and 2008</p>
<p>这个没用过，只是当时在官网上看到过。</p>
<h3 id="VisVim（免费）">VisVim（免费）</h3><p>以上都只是支持Visual Studio，如果还在用VC6.0可以考虑一下这个，此插件是打开vim来编辑当前文件的，并且vim得是OLE的GUI版本才行。</p>
<p>使用方法可以参考<a href="http://blog.csdn.net/absurd/article/details/1164127" target="_blank" rel="external">http://blog.csdn.net/absurd/article/details/1164127</a></p>
<h2 id="Eclipse中的vim插件">Eclipse中的vim插件</h2><h3 id="viPlugin（收费）">viPlugin（收费）</h3><p>地址：<a href="http://www.viplugin.com/" target="_blank" rel="external">http://www.viplugin.com/</a></p>
<p>不错的插件，功能上比其他的要好，不过要收费。</p>
<h3 id="Vrapper（免费）">Vrapper（免费）</h3><p>地址：<a href="http://vrapper.sourceforge.net" target="_blank" rel="external">http://vrapper.sourceforge.net</a></p>
<p>Vrapper也比较不错，但是比上面那位还是弱点。</p>
<p>已知的问题有当要删的词位于行末时dw会连换行符也删掉，搜索结果不高亮。</p>
<h3 id="VimPlugin（免费）">VimPlugin（免费）</h3><p>地址：<a href="http://sourceforge.net/projects/vimplugin/" target="_blank" rel="external">http://sourceforge.net/projects/vimplugin/</a></p>
<p>VimPlugin需要gvim的支持。</p>
<p>使用方法可以参考：<a href="http://akunamotata.iteye.com/blog/324637" target="_blank" rel="external">http://akunamotata.iteye.com/blog/324637</a></p>
<h3 id="eclim（免费）">eclim（免费）</h3><p>eclim是直接调用了vim，而不是模拟。</p>
<p>地址：<a href="http://eclim.org/" target="_blank" rel="external">http://eclim.org/</a></p>
<p>项目主页：<a href="http://eclim.sourceforge.net/" target="_blank" rel="external">http://eclim.sourceforge.net/</a></p>
<p>关于eclipse中的插件还可以参考：<a href="http://paddy-w.iteye.com/blog/969366" target="_blank" rel="external">http://paddy-w.iteye.com/blog/969366</a></p>
<h2 id="Netbeans_IDE中的Vim插件：Jvi">Netbeans IDE中的Vim插件：Jvi</h2><p>地址：<a href="http://jvi.sourceforge.net/" target="_blank" rel="external">http://jvi.sourceforge.net/</a></p>
<p>jVi是Vim一些基本功能的JAVA版实现。在netbeans里面可以很方便地启用和禁用jVi编辑器。jVi目前支持超过200个vim命令：</p>
<p><a href="http://jvi.sourceforge.net/vimhelp/help.txt.html#reference_toc" target="_blank" rel="external">http://jvi.sourceforge.net/vimhelp/help.txt.html#reference_toc</a></p>
<h2 id="JetBrains_中的Vim插件：IdeaVIM">JetBrains 中的Vim插件：IdeaVIM</h2><p>地址：<a href="https://plugins.jetbrains.com/plugin/164" target="_blank" rel="external">https://plugins.jetbrains.com/plugin/164</a></p>
<p>按ctrl+alt+v 可启用此Vim模拟器。</p>
<h2 id="Chrome">Chrome</h2><h3 id="Vimium">Vimium</h3><p>地址：<a href="https://chrome.google.com/webstore/detail/dbepggeogbaibhgnhhndojpepiihcmeb" target="_blank" rel="external">https://chrome.google.com/webstore/detail/dbepggeogbaibhgnhhndojpepiihcmeb</a></p>
<p>用这个插件的人貌似比较多，？可以查看可以使用的命令。</p>
<p>具体使用可以参考<a href="http://kejibo.com/chrome-vimium/" target="_blank" rel="external">http://kejibo.com/chrome-vimium/</a></p>
<h3 id="Vrome">Vrome</h3><p>地址：<a href="https://chrome.google.com/webstore/detail/godjoomfiimiddapohpmfklhgmbfffjj" target="_blank" rel="external">https://chrome.google.com/webstore/detail/godjoomfiimiddapohpmfklhgmbfffjj</a></p>
<p>最近才发现另一个不错的插件 Vrome，前身是Vimlike Smooziee，作者是国人，支持一下。感觉功能比Vimium强，不过似乎不太火。</p>
<p>特色：</p>
<p>缩放网页</p>
<p>C-y 缩短当前网址，并且复制缩短后的地址到剪贴板（此功能需要设置，此插件设置很不错，可以像配置vim一样简单配置下）</p>
<p>C-i  使用外部编辑器编辑等。</p>
<p>具体可以参考：<a href="http://linuxtoy.org/archives/vimlike-smooziee-chrome-vim-extension.html#comment-133032" target="_blank" rel="external">http://linuxtoy.org/archives/vimlike-smooziee-chrome-vim-extension.html#comment-133032</a></p>
<h2 id="Firefox">Firefox</h2><h3 id="Pentadactyl">Pentadactyl</h3><p>地址：<a href="https://addons.mozilla.org/en-US/firefox/addon/pentadactyl/" target="_blank" rel="external">https://addons.mozilla.org/en-US/firefox/addon/pentadactyl/</a></p>
<h3 id="Vimperator">Vimperator</h3><p>地址：<a href="https://addons.mozilla.org/en-US/firefox/addon/vimperator/" target="_blank" rel="external">https://addons.mozilla.org/en-US/firefox/addon/vimperator/</a></p>
<p>不怎么用火狐，感兴趣的话可以参考：<a href="http://xbeta.info/vimperator.htm" target="_blank" rel="external">http://xbeta.info/vimperator.htm</a></p>
<h2 id="在bash中使用vi">在bash中使用vi</h2><p>Bash中默认是emacs模，你可以用命令<code>set -o vi</code>来设置为vi模式。如果想一直使用vi模式，你可以把<code>set -o vi</code>加入到家目录下的配置文件<code>.bashrc</code>中。</p>
<p>其实还可以用autohotkey来在别的软件中实现vim模式的，有人已经写了一个叫Vim_Mode的脚本，有兴趣的可以下载使用：<a href="http://pan.baidu.com/s/1nt9W6oh" target="_blank" rel="external">http://pan.baidu.com/s/1nt9W6oh</a></p>

      
    </div>
    <footer class="article-footer">
	  
	  <!-- 百度分享 Start -->
	  <div class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a><a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a></div>
	  <!-- 百度分享 End -->
	  
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Vim/">Vim</a></li></ul>

	  
<span>
Updated:<time datetime="2015-07-13T15:56:22.000Z" itemprop="dateModified">2015-07-13</time>
</span>


    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2013/04/26/use-hexo/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          hexo使用笔记
        
      </div>
    </a>
  
  
</nav>

  
</article>



<!-- 多说评论框 start -->

<section id="comments">
  <div class="ds-thread"  data-thread-key="/2012/03/17/software-which-behaves-like-vim/" data-title="用vim的方式操作你的软件" data-url="http://howiefh.github.io/2012/03/17/software-which-behaves-like-vim/" id="ds_thread">
    <noscript>Please enable JavaScript to view the <a href="//duoshuo.com/?ref_noscript">comments powered by duoshuo.</a></noscript>
  </div>
</section>

<!-- 多说评论框 end -->
</section>
        
          
  <div id="toc" class="toc-aside">
  <h2 class="toc-title">Contents</h2>
    
        <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Visual_Studio中的Vim插件"><span class="toc-number">1.</span> <span class="toc-text">Visual Studio中的Vim插件</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#ViEmu（收费）"><span class="toc-number">1.1.</span> <span class="toc-text">ViEmu（收费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#VsVim（免费）"><span class="toc-number">1.2.</span> <span class="toc-text">VsVim（免费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#visual_studio-vim（免费）"><span class="toc-number">1.3.</span> <span class="toc-text">visual_studio.vim（免费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#VisVim（免费）"><span class="toc-number">1.4.</span> <span class="toc-text">VisVim（免费）</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Eclipse中的vim插件"><span class="toc-number">2.</span> <span class="toc-text">Eclipse中的vim插件</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#viPlugin（收费）"><span class="toc-number">2.1.</span> <span class="toc-text">viPlugin（收费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Vrapper（免费）"><span class="toc-number">2.2.</span> <span class="toc-text">Vrapper（免费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#VimPlugin（免费）"><span class="toc-number">2.3.</span> <span class="toc-text">VimPlugin（免费）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#eclim（免费）"><span class="toc-number">2.4.</span> <span class="toc-text">eclim（免费）</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Netbeans_IDE中的Vim插件：Jvi"><span class="toc-number">3.</span> <span class="toc-text">Netbeans IDE中的Vim插件：Jvi</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#JetBrains_中的Vim插件：IdeaVIM"><span class="toc-number">4.</span> <span class="toc-text">JetBrains 中的Vim插件：IdeaVIM</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Chrome"><span class="toc-number">5.</span> <span class="toc-text">Chrome</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Vimium"><span class="toc-number">5.1.</span> <span class="toc-text">Vimium</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Vrome"><span class="toc-number">5.2.</span> <span class="toc-text">Vrome</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Firefox"><span class="toc-number">6.</span> <span class="toc-text">Firefox</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Pentadactyl"><span class="toc-number">6.1.</span> <span class="toc-text">Pentadactyl</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Vimperator"><span class="toc-number">6.2.</span> <span class="toc-text">Vimperator</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#在bash中使用vi"><span class="toc-number">7.</span> <span class="toc-text">在bash中使用vi</span></a></li></ol>
    
  </div>

<aside id="sidebar">

  
    
<div class="widget-wrap">
  <h3 class="widget-title">ABOUT ME</h3>
  <ul class="widget about-me">
    
    <li><img class="author" title="About me" src="http://fh-1.qiniudn.com/okal-eltocat.jpg" /></li>
    
    
    <li>Hi,I'm FengHao.</li>
    
    <li>I'll share something interesting and my learning experience with you at this blog.</li>
    
    <li>前博客:<a href="http://hi.baidu.com/idea_star" target="_BLANK">百度空间</a></li>
    
  </ul>
</div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Android/">Android</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/C/">C</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Database/">Database</a><span class="category-list-count">13</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/Database/MongoDB/">MongoDB</a><span class="category-list-count">10</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Database/MySQL/">MySQL</a><span class="category-list-count">2</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/Eclipse/">Eclipse</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/FTP/">FTP</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Git/">Git</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Hexo/">Hexo</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Java/">Java</a><span class="category-list-count">20</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/Java/FreeMarker/">FreeMarker</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Java/Shiro/">Shiro</a><span class="category-list-count">2</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/JavaEE/">JavaEE</a><span class="category-list-count">4</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/JavaEE/Hibernate/">Hibernate</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/JavaEE/JSP/">JSP</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/JavaEE/Spring/">Spring</a><span class="category-list-count">2</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/JavaScript/">JavaScript</a><span class="category-list-count">5</span><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/JavaScript/jQuery/">jQuery</a><span class="category-list-count">1</span></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/Linux/">Linux</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/PHP/">PHP</a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Suse/">Suse</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Ubuntu/">Ubuntu</a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Vim/">Vim</a><span class="category-list-count">8</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/编程/">编程</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/软件/">软件</a><span class="category-list-count">1</span></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Android/" style="font-size: 14.75px; color: #65bfa7">Android</a> <a href="/tags/C/" style="font-size: 13.88px; color: #71c1c2">C</a> <a href="/tags/CAS/" style="font-size: 13px; color: #7dc3de">CAS</a> <a href="/tags/Chrome/" style="font-size: 13px; color: #7dc3de">Chrome</a> <a href="/tags/Clean-Code/" style="font-size: 13.88px; color: #71c1c2">Clean Code</a> <a href="/tags/Database/" style="font-size: 13px; color: #7dc3de">Database</a> <a href="/tags/Eclipse/" style="font-size: 13px; color: #7dc3de">Eclipse</a> <a href="/tags/FTP/" style="font-size: 13.88px; color: #71c1c2">FTP</a> <a href="/tags/FreeMarker/" style="font-size: 14.75px; color: #65bfa7">FreeMarker</a> <a href="/tags/Gcc/" style="font-size: 13px; color: #7dc3de">Gcc</a> <a href="/tags/Git/" style="font-size: 14.75px; color: #65bfa7">Git</a> <a href="/tags/Github-Pages/" style="font-size: 13px; color: #7dc3de">Github Pages</a> <a href="/tags/Hexo/" style="font-size: 14.75px; color: #65bfa7">Hexo</a> <a href="/tags/Hibernate/" style="font-size: 13px; color: #7dc3de">Hibernate</a> <a href="/tags/JSP/" style="font-size: 13px; color: #7dc3de">JSP</a> <a href="/tags/JVM/" style="font-size: 14.75px; color: #65bfa7">JVM</a> <a href="/tags/Java/" style="font-size: 14.75px; color: #65bfa7">Java</a> <a href="/tags/JavaMail/" style="font-size: 13px; color: #7dc3de">JavaMail</a> <a href="/tags/JavaScript/" style="font-size: 16.5px; color: #4dbc6f">JavaScript</a> <a href="/tags/Linux/" style="font-size: 13.88px; color: #71c1c2">Linux</a> <a href="/tags/Log/" style="font-size: 13px; color: #7dc3de">Log</a> <a href="/tags/Markdown/" style="font-size: 13.88px; color: #71c1c2">Markdown</a> <a href="/tags/MongoDB/" style="font-size: 20px; color: #1db400">MongoDB</a> <a href="/tags/MySQL/" style="font-size: 13.88px; color: #71c1c2">MySQL</a> <a href="/tags/PHP/" style="font-size: 16.5px; color: #4dbc6f">PHP</a> <a href="/tags/Rhythmbox/" style="font-size: 13px; color: #7dc3de">Rhythmbox</a> <a href="/tags/SSO/" style="font-size: 13px; color: #7dc3de">SSO</a> <a href="/tags/Servlet/" style="font-size: 13px; color: #7dc3de">Servlet</a> <a href="/tags/Shiro/" style="font-size: 13.88px; color: #71c1c2">Shiro</a> <a href="/tags/Spring/" style="font-size: 13.88px; color: #71c1c2">Spring</a> <a href="/tags/Suse/" style="font-size: 13px; color: #7dc3de">Suse</a> <a href="/tags/Thinking-in-Java/" style="font-size: 19.13px; color: #29b61c">Thinking in Java</a> <a href="/tags/Ubuntu/" style="font-size: 17.38px; color: #41ba53">Ubuntu</a> <a href="/tags/Vim/" style="font-size: 18.25px; color: #35b838">Vim</a> <a href="/tags/VirtualBox/" style="font-size: 13px; color: #7dc3de">VirtualBox</a> <a href="/tags/Vsftpd/" style="font-size: 13px; color: #7dc3de">Vsftpd</a> <a href="/tags/jQuery/" style="font-size: 13px; color: #7dc3de">jQuery</a> <a href="/tags/pam-mysql/" style="font-size: 13px; color: #7dc3de">pam_mysql</a> <a href="/tags/小米/" style="font-size: 13px; color: #7dc3de">小米</a> <a href="/tags/软件/" style="font-size: 15.63px; color: #59bd8b">软件</a>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/09/">September 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/08/">August 2015</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/07/">July 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/05/">May 2015</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/04/">April 2015</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/03/">March 2015</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/02/">February 2015</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/12/">December 2014</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/11/">November 2014</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/10/">October 2014</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/09/">September 2014</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/08/">August 2014</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/07/">July 2014</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/06/">June 2014</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/05/">May 2014</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/04/">April 2014</a><span class="archive-list-count">4</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/03/">March 2014</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/02/">February 2014</a><span class="archive-list-count">11</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/01/">January 2014</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/12/">December 2013</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/11/">November 2013</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/08/">August 2013</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/07/">July 2013</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/06/">June 2013</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/05/">May 2013</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2013/04/">April 2013</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2012/03/">March 2012</a><span class="archive-list-count">1</span></li></ul>
    </div>
  </div>


  
    <div class="widget-wrap">
  <h3 class="widget-title">Calendar</h3>
  <div class="widget">
    <div id="g-calendar" class="g-calendar">
        <span class="g-calendar-prev"></span>
		 
        <span class="g-calendar-back"></span>
        <span class="g-calendar-now"></span>
		 
        <span class="g-calendar-next"></span>
        <div class="g-calendar-hd"></div>
        <div class="g-calendar-tit"></div>
        <div class="g-calendar-bd"></div>
    </div>
  </div>
</div>
<script type="text/javascript">
function LGY_calendar(wrapId, options){
    this.oWrap = this.getId(wrapId);
    this.oHead = this.getByClassName('g-calendar-hd',this.oWrap)[0];
    this.oBody = this.getByClassName('g-calendar-bd',this.oWrap)[0];
    this.oTit = this.getByClassName('g-calendar-tit',this.oWrap)[0];
    this.oPrev = this.getByClassName('g-calendar-prev',this.oWrap)[0];
    this.oNext = this.getByClassName('g-calendar-next',this.oWrap)[0];
    this.oNow = this.getByClassName('g-calendar-now',this.oWrap)[0];
    this.oBack = this.getByClassName('g-calendar-back',this.oWrap)[0];
    this.init();
}
LGY_calendar.prototype = {
    ///////////获取ID元素
    getId:function(id){
        return document.getElementById(id);
    },
    ////////获取css类名元素
    getByClassName:function(className,parent){
        var elem = [],
            node = parent != undefined&&parent.nodeType==1?parent.getElementsByTagName('*'):document.getElementsByTagName('*'),
            p = new RegExp("(^|\\s)"+className+"(\\s|$)");
        for(var n=0,i=node.length;n<i;n++){
            if(p.test(node[n].className)){
                elem.push(node[n]);
            }
        }
        return elem;
    },
    //填充日历
    fillDate:function(year,month){
        //本月份第一天是星期几-为显示上个月的天数做铺垫
        var first_day = new Date(year,month,1).getDay(),
        //如果刚好是星期天，则空出一行（显示上个月的天数）
            first_day = first_day == 0?first_day=7:first_day;
        //本月份最后一天是几号
        var final_date = new Date(year,month+1,0).getDate(),
        //上个月的最后一天是几号
            last_date = new Date(year,month,0).getDate(),
        //剩余的格子数--即排在末尾的格子数
            surplus = 42 - first_day - final_date;
        //设置年的链接
        var yearHead = "<a href='/" + "archives/" + year + "/'>" + year + " "+ "</a>"; 
        //设置年的链接
        var monthHead = "";
        var month1 = month + 1;
        if (month1 < 10) {
            monthHead = "<a href='/" + "archives/" + year + "/" + "0" + month1 + "/'>" + " " + month1 + " " + "</a>";
        } else {
            monthHead = "<a href='/" + "archives/" + year + "/" + month1 + "/'>" + " " + month1 + " " + "</a>";
        }
        //设置表头的日历
        this.oHead.innerHTML = yearHead+'年'+monthHead+'月';
        //填充日历执行
        var html = '';
        //上个月的显示天数
        for(var i=0;i<first_day;i++){
            html+='<span class="g-calendar-grey">'+(last_date-(first_day-1)+i)+'</span>';
        }
        //本月的显示天数
        var postdate = new Date("Sat Mar 17 2012 23:03:09 GMT+0800"); 
        if (true && postdate.getFullYear() == year && postdate.getMonth() == month) { 
            html += '<span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span>10</span><span>11</span><span>12</span><span>13</span><span>14</span><span>15</span><span>16</span><span><a href="/2012/03/17/software-which-behaves-like-vim/" title="用vim的方式操作你的软件">17</a></span><span>18</span><span>19</span><span>20</span><span>21</span><span>22</span><span>23</span><span>24</span><span>25</span><span>26</span><span>27</span><span>28</span><span>29</span>';
        } else {
            for(var j=0;j<final_date;j++){        
                html+='<span id="d'+(j+1)+'">'+(j+1)+'</span>';
            }
        }
        //下个月的显示天数
        for(var k=0;k<surplus;k++){
            html+='<span class="g-calendar-grey">'+(k+1)+'</span>';
        }
        //fill
        this.oBody.innerHTML = html;
        // 当前状态
        if(year==this.c_year&&this.c_month==month){
            this.oBody.getElementsByTagName('span')[first_day+this.date-1].className='g-calendar-on';
        }

        // 对所有文章遍历,然后将有文章的日期加上链接,如果文章太多的话,生成页面会很大,去掉了
        
    },
    // next切换
    next:function(){
        var _that = this;
        this.oNext.onclick = function(){
            _that.month++;
            if(_that.month>11){
                _that.month = 0;
                _that.year++;
            }
            // 填充日历
            _that.fillDate(_that.year,_that.month);
        };
    },
    // back 切换
    back:function(){
        var _that = this;
        if(this.oBack != undefined) {
            this.oBack.onclick = function(){
                var postdate = new Date("Sat Mar 17 2012 23:03:09 GMT+0800"); 
                _that.year = postdate.getFullYear();
                _that.month = postdate.getMonth();
                // 填充日历
                _that.fillDate(_that.year,_that.month);
            };
        }
    },
    // now切换
    now:function(){
        var _that = this;
        if(this.oNow != undefined ) {
            this.oNow.onclick = function(){
                var nowDate = new Date(); 
                _that.year = nowDate.getFullYear();
                _that.month = nowDate.getMonth();
                // 填充日历
                _that.fillDate(_that.year,_that.month);
            };
        }
    },
    // prev切换
    prev:function(){
        var _that = this;
        this.oPrev.onclick = function(){
            _that.month--;
            if(_that.month<0){
                _that.month = 11;
                _that.year--;
            }
            // 填充日历
            _that.fillDate(_that.year,_that.month);
        };
    },
    init:function(){
        this.oTit.innerHTML = '<span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span>';
        // 获取今天的日历时间
        var now = new Date();
        this.c_year = this.year = now.getFullYear();
        this.c_month = this.month = now.getMonth();
        this.date = now.getDate();
        // 初始化--填充日历
        this.fillDate(this.year,this.month);
        //next切换
        this.next();
        //prev切换
        this.prev();
        //back 切换
        this.back();
        //now 切换
        this.now();
    }
}
new LGY_calendar('g-calendar');
</script>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2015/09/01/javascript-summary/">JavaScript 总结</a>
          </li>
        
          <li>
            <a href="/2015/08/28/javascript-oop-function-expression-and-async/">JavaScript 面向对象程序设计、函数表达式和异步编程</a>
          </li>
        
          <li>
            <a href="/2015/08/28/javascript-reference-type/">JavaScript 引用类型</a>
          </li>
        
          <li>
            <a href="/2015/08/28/javascript-grammar/">JavaScript 基本语法</a>
          </li>
        
          <li>
            <a href="/2015/08/10/java-web/">Java Web 笔记</a>
          </li>
        
      </ul>
    </div>
  </div>


  
    
<div class="widget-wrap">
  <h3 class="widget-title">Recent Comments</h3>
  <ul class="widget ds-recent-comments" data-num-items="5" data-show-avatars="0" data-show-title="1" data-show-time="1"></ul>
</div>
<!-- 需要多说的公用代码 -->


  

</aside>

        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2015 howiefh<br>
      Powered by <a href="http://zespia.tw/hexo/" target="_blank">Hexo</a> and Theme by <a href="https://github.com/howiefh/hexo-theme-landscape-f" target="_blank" title="Landscape-F">Landscape-F</a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<!-- 多说公共JS代码 start (一个网页只需插入一次) -->

<script type="text/javascript">
  var duoshuoQuery = {short_name:"howiefh"};
  (function() {
	var ds = document.createElement('script');
	ds.type = 'text/javascript';ds.async = true;
	ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
	ds.charset = 'UTF-8';
	(document.getElementsByTagName('head')[0] 
		|| document.getElementsByTagName('body')[0]).appendChild(ds);
  })();
</script> 

<!-- 多说公共JS代码 end -->

<!-- 百度分享 start -->

<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":["mshare","douban","bdysc","sqq","qq","hi","baidu","huaban","youdao","sdo","mail","xg","diandian","fx","copy","print"],"bdPic":"","bdStyle":"1","bdSize":"16"},"share":{},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到：","viewSize":"16"}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>

<!-- 百度分享 end -->

<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="/js/jquery.min.js"></script>
-->
<script src="/js/jquery.min.js" type="text/javascript"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css">
  <script src="/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>


<div class="bottom-btn">

	<a class="icon-gotop" href="javascript:void(0)" title="返回顶部"></a>
	<script src="/js/gotop.js" type="text/javascript"></script>
	<!--
	<script src="/js/gotop.js"></script>
	-->


	<a class="icon-toc-toggle" href="javascript:void(0)" title="文章目录"></a>
	<!--
	<script src="/js/toc_aside_toggle.js"></script>
	-->

</div>
<script src="/js/toc_aside_toggle.js" type="text/javascript"></script>


<script src="/js/script.js" type="text/javascript"></script>

  </div>
</body>
</html>
